/**
 * Project Name:xiaocao-java-basic
 * File Name:HttpClientEnhancement.java
 * Package Name:top.wanzc.java.basic.jdk9.to17.feature
 * Date:2024年2月10日上午11:29:31
 * Copyright (c) 2024, zhengchong.wan@minicore.com.hk All Rights Reserved.
 *
*/

package top.wanzc.java.basic.jdk9.to17.feature;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

/**
 * @className:HttpClientEnhancement 
 * @comment: 注释信息 
 * @date:     2024年2月10日 上午11:29:31 
 * @author   zhengchong.wan
 * @since    V1.0.0	 
 */
public class HttpClientEnhancement {

	public static void main(String[] args) throws Exception {
		HttpClient client = HttpClient.newBuilder().version(HttpClient.Version.HTTP_2).build();
		HttpRequest req = HttpRequest.newBuilder(URI.create("https://www.baidu.com")).build();
		HttpResponse<String> resp = client.send(req,HttpResponse.BodyHandlers.ofString());
		System.out.println(resp.body());
	}

}

